﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

public class Student
    {
        private string names;
        private int facultyNumber;

        public Student(string names, int facultyNumber)
        {
            this.Names = names;
            this.FacultyNumber = facultyNumber;
        }

        public string Names
        {
            get
            {
                return this.names;
            }
            set
            {
                if (value != null && value != "")
                {
                    this.names = value;
                }
                else
                {
                    throw new ArgumentException("Invalid Names - null or empty");
                }
            }
        }
        public int FacultyNumber
        {
            get
            {
                return this.facultyNumber;
            }
            set
            {
                if (value > 10000 && value < 99999)
                {
                    this.facultyNumber = value;
                }
                else
                {
                    throw new ArgumentOutOfRangeException("Faculty Number is not between 10000 and 99999");
                }
            }
        }

        public override bool Equals(object obj)
        {
            Student tmp;
            if ((tmp = obj as Student) != null)
            {
                return this.FacultyNumber.Equals(tmp.FacultyNumber);
            }
            else
            {
                return false;
            }
        }
        public override int GetHashCode()
        {
            return this.FacultyNumber.GetHashCode();
        }
    }
